
import 'package:bxultimate/app/router/router_name.dart';
import 'package:bxultimate/data/store/auth_store.dart';
import 'package:flutter/material.dart';
import 'package:get/get.dart';


class LoginUserMiddleware extends GetMiddleware {
  @override
  int? priority = 1;


  @override
  RouteSettings? redirect(String? route) {
    if (!AuthStore.to.isLogin) {
      Future.delayed(Duration(seconds: 1), () => Get.snackbar("提示", "请先登录"));
      return RouteSettings(name: RouterName.userLogin);
    }
  }
}
